package com.example.service;

import com.example.entity.StudentInfo;
import com.example.mapper.StudentInfoMapper;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentInfoService {

    private static final Logger log = LoggerFactory.getLogger(StudentInfoService.class);

    @Resource
    private StudentInfoMapper studentInfoMapper;

    public void add(StudentInfo studentInfo) {
        studentInfoMapper.insert(studentInfo);
    }

    public void updateById(StudentInfo studentInfo) {
        studentInfoMapper.updateById(studentInfo);
    }

    public void deleteByUserId(Integer userId) {
        studentInfoMapper.deleteByUserId(userId);
    }

    public StudentInfo selectByUserId(Long userId) {
        return studentInfoMapper.selectByUserId(userId);
    }

}
